{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "ename": "",
     "evalue": "",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31mRunning cells with 'Python 3.5.2' requires the ipykernel package.\n",
      "\u001b[1;31mRun the following command to install 'ipykernel' into the Python environment. \n",
      "\u001b[1;31mCommand: '/usr/bin/python3 -m pip install ipykernel -U --user --force-reinstall'"
     ]
    }
   ],
   "source": [
    "# clean the exp dirs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "train31\n",
      "train23\n",
      "train22\n",
      "train2\n",
      "train13\n",
      "the folder train52 has PR_curve.png\n",
      "the folder train37 has PR_curve.png\n",
      "train302\n",
      "the folder train5 has PR_curve.png\n",
      "the folder train36 has PR_curve.png\n",
      "the folder train292 has PR_curve.png\n",
      "train14\n",
      "train9\n",
      "train25\n",
      "train12\n",
      "the folder train30 has PR_curve.png\n",
      "train17\n",
      "the folder train29 has PR_curve.png\n",
      "train\n",
      "train28\n",
      "train26\n",
      "train21\n",
      "train20\n",
      "train8\n",
      "train15\n",
      "the folder train42 has PR_curve.png\n",
      "the folder train6 has PR_curve.png\n",
      "train19\n",
      "train18\n",
      "the folder train4 has PR_curve.png\n",
      "the folder train372 has PR_curve.png\n",
      "train33\n",
      "train24\n",
      "the folder train362 has PR_curve.png\n",
      "the folder train32 has PR_curve.png\n",
      "train27\n",
      "the folder train3 has PR_curve.png\n",
      "train16\n",
      "the folder train7 has PR_curve.png\n",
      "the folder train62 has PR_curve.png\n",
      "the folder train293 has PR_curve.png\n",
      "train11\n",
      "train10\n",
      "train35\n",
      "the folder train72 has PR_curve.png\n",
      "train34\n"
     ]
    }
   ],
   "source": [
    "# find all those folder without the file PR_curve.png\n",
    "import os\n",
    "root = '/root/iscas/yolov11/runs/detect'\n",
    "for folder in os.listdir(root):\n",
    "    if os.path.exists(os.path.join(root, folder, 'PR_curve.png')):\n",
    "        print(f'the folder {folder} has PR_curve.png')\n",
    "        continue\n",
    "    print(folder)\n",
    "    os.system('rm -rf ' + os.path.join(root, folder))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "yolov11",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.16"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
